package com.woniu.sharepark.leasesystem.common.service;


import com.alipay.api.AlipayApiException;
import com.woniu.sharepark.common.JsonResult;
import com.woniu.sharepark.leasesystem.common.pojo.OrderForm;
import com.woniu.sharepark.leasesystem.lessor.pojo.CarPark;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderFormService {



    /**
    *
    * @title 查询支付信息
    * @param orderFormId
    * @return com.woniu.sharepark.pojo.OrderForm
    * @author DELL
    * @date 2019/6/3 15:18
    **/
    OrderForm selectOrderFormById(Integer orderFormId);

    /**
    * 租车位支付
    * @title payOrder
    * @param date
    * @return java.lang.Integer
    * @author DELL
    * @date 2019/6/10 10:07
    **/

    JsonResult payOrder(Date date,Integer voucherId);

    /**
     *  分页查询订单信息
     * @param currentPage
     * @param pageSize
     * @return
     */

    List<OrderForm> selectConsumptionList(Integer currentPage, Integer pageSize);

    /**
    * 生成订单编号
    * @title createOrderNumber
    * @param carPark
    * @return java.lang.Integer
    * @author DELL
    * @date 2019/6/6 10:30
    **/
    JsonResult createOrderNumber(CarPark carPark);

    /**
     * 充值
     * @param money
     * @return
     */
    String invest(Double money) throws AlipayApiException;

    /**
    * 通过车位查询订单(已租)
    * @title findByCids
    * @param cids 车位号集合
    * @return: java.util.List<com.woniu.sharepark.leasesystem.common.pojo.OrderForm>
    * @author xin
    * @date 2019/6/6 10:46
    */
    List<OrderForm> findByCids(String cids);

   /**
   * 通过车位查询订单(完成)
   * @title selectOrderByCids
   * @param cids
   * @return java.util.List<com.woniu.sharepark.leasesystem.common.pojo.OrderForm>
   * @author xin
   * @date 2019/6/20 18:33
   */
    List<OrderForm> findOrderByCids(String cids);

    /**
    * 查询所有已完成订单
    * @title findAllOrder
    * @return java.util.List<com.woniu.sharepark.leasesystem.common.pojo.OrderForm>
    * @author xin
    * @date 2019/6/20 18:34
    */
    List<OrderForm> findAllOrder();


    /**
    * 充值成功
    * @title alipaySuccess
    * @param request, response
    * @return java.lang.String
    * @author DELL
    * @date 2019/6/10 14:42
    **/

    String alipaySuccess(HttpServletRequest request, HttpServletRequest response) throws AlipayApiException, UnsupportedEncodingException;
    /**
    * 租车订单完成修改相应状态
    * @title orderSuccess
    * @param orderForm
    * @return void
    * @author DELL
    * @date 2019/6/11 19:27
    **/

    void orderSuccess(OrderForm orderForm);

    /**
    * 订单及userinfo
    * @title findOrderById
    * @param id
    * @return java.util.Map
    * @author DELL
    * @date 2019/6/14 22:11
    **/

    Map findOrderById(Integer id);

    /**
    * 查询当前用户已完成订单
    * @title findAllOrderForm
    * @param getuId
    * @return java.util.List
    * @author DELL
    * @date 2019/6/15 13:06
    **/

    List findAllOrderForm(Integer getuId,String orderStatus);

    /**
    * 查询未付款订单
    * @title payIng
    * @param
    * @return com.woniu.sharepark.leasesystem.common.pojo.OrderForm
    * @author DELL
    * @date 2019/6/15 16:47
    **/

    JsonResult payIng();





    /**
    * 统计完成订单数量
    * @title coountSuccessOrder
    * @param getuId
    * @return java.lang.Integer
    * @author DELL
    * @date 2019/6/20 15:34
    **/

    Integer coountSuccessOrder(Integer getuId);

    /**
     * 查找当前用户所有订单信息
     *
     * @return com.woniu.sharepark.common.JsonResult
     * @Author Zongjie.Li
     * @Date 2019/6/20
     * @Version 1.0
     */
    JsonResult findAllOrderToJsonResult();
}
